package com.jtcl.netty;

import com.jtcl.netty.config.ServerDeploy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
 * @author sjt
 * @since 2021-02-23 16:34
 */
@Component
@ConditionalOnProperty(value = "jtcl.netty.server-port")
public class ServerStarter implements CommandLineRunner {

    @Autowired
    ServerDeploy serverDeploy;

    @Override
    public void run(String... args) throws Exception {
        serverDeploy.start();
    }
}
